3.39 \(\int (c+d x) (a+b \cot (e+f x)) \, dx\)

Optimal. Leaf size=83 \[ -\frac{i b d \text{PolyLog}\left (2,e^{2 i (e+f x)}\right )}{2 f^2}+\frac{a (c+d x)^2}{2 d}+\frac{b (c+d x) \log \left (1-e^{2 i (e+f x)}\right )}{f}-\frac{i b (c+d x)^2}{2 d} \]

[Out]

(a*(c + d*x)^2)/(2*d) - ((I/2)*b*(c + d*x)^2)/d + (b*(c + d*x)*Log[1 - E^((2*I)*(e + f*x))])/f - ((I/2)*b*d*Po
lyLog[2, E^((2*I)*(e + f*x))])/f^2

________________________________________________________________________________________

Rubi [A]  time = 0.122931, antiderivative size = 83, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.312, Rules used = {3722, 3717, 2190, 2279, 2391} \[ -\frac{i b d \text{PolyLog}\left (2,e^{2 i (e+f x)}\right )}{2 f^2}+\frac{a (c+d x)^2}{2 d}+\frac{b (c+d x) \log \left (1-e^{2 i (e+f x)}\right )}{f}-\frac{i b (c+d x)^2}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*x)*(a + b*Cot[e + f*x]),x]

[Out]

(a*(c + d*x)^2)/(2*d) - ((I/2)*b*(c + d*x)^2)/d + (b*(c + d*x)*Log[1 - E^((2*I)*(e + f*x))])/f - ((I/2)*b*d*Po
lyLog[2, E^((2*I)*(e + f*x))])/f^2

Rule 3722

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, (a + b*Tan[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]

Rule 3717

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + Pi*(k_.) + (f_.)*(x_)], x_Symbol] :> Simp[(I*(c + d*x)^(m + 1))/(d*
(m + 1)), x] - Dist[2*I, Int[((c + d*x)^m*E^(2*I*k*Pi)*E^(2*I*(e + f*x)))/(1 + E^(2*I*k*Pi)*E^(2*I*(e + f*x)))
, x], x] /; FreeQ[{c, d, e, f}, x] && IntegerQ[4*k] && IGtQ[m, 0]

Rule 2190

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m*Log[1 + (b*(F^(g*(e + f*x)))^n)/a])/(b*f*g*n*Log[F]), x]
 - Dist[(d*m)/(b*f*g*n*Log[F]), Int[(c + d*x)^(m - 1)*Log[1 + (b*(F^(g*(e + f*x)))^n)/a], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2279

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rubi steps

\begin{align*} \int (c+d x) (a+b \cot (e+f x)) \, dx &=\int (a (c+d x)+b (c+d x) \cot (e+f x)) \, dx\\ &=\frac{a (c+d x)^2}{2 d}+b \int (c+d x) \cot (e+f x) \, dx\\ &=\frac{a (c+d x)^2}{2 d}-\frac{i b (c+d x)^2}{2 d}-(2 i b) \int \frac{e^{2 i (e+f x)} (c+d x)}{1-e^{2 i (e+f x)}} \, dx\\ &=\frac{a (c+d x)^2}{2 d}-\frac{i b (c+d x)^2}{2 d}+\frac{b (c+d x) \log \left (1-e^{2 i (e+f x)}\right )}{f}-\frac{(b d) \int \log \left (1-e^{2 i (e+f x)}\right ) \, dx}{f}\\ &=\frac{a (c+d x)^2}{2 d}-\frac{i b (c+d x)^2}{2 d}+\frac{b (c+d x) \log \left (1-e^{2 i (e+f x)}\right )}{f}+\frac{(i b d) \operatorname{Subst}\left (\int \frac{\log (1-x)}{x} \, dx,x,e^{2 i (e+f x)}\right )}{2 f^2}\\ &=\frac{a (c+d x)^2}{2 d}-\frac{i b (c+d x)^2}{2 d}+\frac{b (c+d x) \log \left (1-e^{2 i (e+f x)}\right )}{f}-\frac{i b d \text{Li}_2\left (e^{2 i (e+f x)}\right )}{2 f^2}\\ \end{align*}

Mathematica [B]  time = 4.49909, size = 204, normalized size = 2.46 \[ -\frac{b d \csc (e) \sec (e) \left (\frac{\tan (e) \left (i \text{PolyLog}\left (2,e^{2 i \left (\tan ^{-1}(\tan (e))+f x\right )}\right )+i f x \left (2 \tan ^{-1}(\tan (e))-\pi \right )-2 \left (\tan ^{-1}(\tan (e))+f x\right ) \log \left (1-e^{2 i \left (\tan ^{-1}(\tan (e))+f x\right )}\right )+2 \tan ^{-1}(\tan (e)) \log \left (\sin \left (\tan ^{-1}(\tan (e))+f x\right )\right )-\pi \log \left (1+e^{-2 i f x}\right )+\pi \log (\cos (f x))\right )}{\sqrt{\tan ^2(e)+1}}+f^2 x^2 e^{i \tan ^{-1}(\tan (e))}\right )}{2 f^2 \sqrt{\sec ^2(e) \left (\sin ^2(e)+\cos ^2(e)\right )}}+a c x+\frac{1}{2} a d x^2+\frac{b c (\log (\tan (e+f x))+\log (\cos (e+f x)))}{f}+\frac{1}{2} b d x^2 \cot (e) \]

Warning: Unable to verify antiderivative.

[In]

Integrate[(c + d*x)*(a + b*Cot[e + f*x]),x]

[Out]

a*c*x + (a*d*x^2)/2 + (b*d*x^2*Cot[e])/2 + (b*c*(Log[Cos[e + f*x]] + Log[Tan[e + f*x]]))/f - (b*d*Csc[e]*Sec[e
]*(E^(I*ArcTan[Tan[e]])*f^2*x^2 + ((I*f*x*(-Pi + 2*ArcTan[Tan[e]]) - Pi*Log[1 + E^((-2*I)*f*x)] - 2*(f*x + Arc
Tan[Tan[e]])*Log[1 - E^((2*I)*(f*x + ArcTan[Tan[e]]))] + Pi*Log[Cos[f*x]] + 2*ArcTan[Tan[e]]*Log[Sin[f*x + Arc
Tan[Tan[e]]]] + I*PolyLog[2, E^((2*I)*(f*x + ArcTan[Tan[e]]))])*Tan[e])/Sqrt[1 + Tan[e]^2]))/(2*f^2*Sqrt[Sec[e
]^2*(Cos[e]^2 + Sin[e]^2)])

________________________________________________________________________________________

Maple [B]  time = 0.33, size = 240, normalized size = 2.9 \begin{align*} ibcx-{\frac{i}{2}}bd{x}^{2}+{\frac{ad{x}^{2}}{2}}+acx+{\frac{bc\ln \left ({{\rm e}^{i \left ( fx+e \right ) }}-1 \right ) }{f}}+{\frac{bc\ln \left ({{\rm e}^{i \left ( fx+e \right ) }}+1 \right ) }{f}}-2\,{\frac{bc\ln \left ({{\rm e}^{i \left ( fx+e \right ) }} \right ) }{f}}-{\frac{ibd{\it polylog} \left ( 2,{{\rm e}^{i \left ( fx+e \right ) }} \right ) }{{f}^{2}}}-{\frac{ibd{e}^{2}}{{f}^{2}}}-{\frac{2\,ibdex}{f}}+{\frac{bd\ln \left ({{\rm e}^{i \left ( fx+e \right ) }}+1 \right ) x}{f}}-{\frac{ibd{\it polylog} \left ( 2,-{{\rm e}^{i \left ( fx+e \right ) }} \right ) }{{f}^{2}}}+{\frac{bd\ln \left ( 1-{{\rm e}^{i \left ( fx+e \right ) }} \right ) x}{f}}+{\frac{bd\ln \left ( 1-{{\rm e}^{i \left ( fx+e \right ) }} \right ) e}{{f}^{2}}}-{\frac{bde\ln \left ({{\rm e}^{i \left ( fx+e \right ) }}-1 \right ) }{{f}^{2}}}+2\,{\frac{bde\ln \left ({{\rm e}^{i \left ( fx+e \right ) }} \right ) }{{f}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)*(a+b*cot(f*x+e)),x)

[Out]

I*b*c*x-1/2*I*b*d*x^2+1/2*a*d*x^2+a*c*x+b/f*c*ln(exp(I*(f*x+e))-1)+b/f*c*ln(exp(I*(f*x+e))+1)-2*b/f*c*ln(exp(I
*(f*x+e)))-I*b/f^2*d*polylog(2,exp(I*(f*x+e)))-I*b/f^2*d*e^2-2*I*b/f*d*e*x+b/f*d*ln(exp(I*(f*x+e))+1)*x-I*b/f^
2*d*polylog(2,-exp(I*(f*x+e)))+b/f*d*ln(1-exp(I*(f*x+e)))*x+b/f^2*d*ln(1-exp(I*(f*x+e)))*e-b/f^2*d*e*ln(exp(I*
(f*x+e))-1)+2*b/f^2*d*e*ln(exp(I*(f*x+e)))

________________________________________________________________________________________

Maxima [B]  time = 1.87715, size = 281, normalized size = 3.39 \begin{align*} \frac{{\left (a - i \, b\right )} d f^{2} x^{2} + 2 \,{\left (a - i \, b\right )} c f^{2} x - 2 i \, b d f x \arctan \left (\sin \left (f x + e\right ), -\cos \left (f x + e\right ) + 1\right ) + 2 i \, b c f \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right ) - 1\right ) - 2 i \, b d{\rm Li}_2\left (-e^{\left (i \, f x + i \, e\right )}\right ) - 2 i \, b d{\rm Li}_2\left (e^{\left (i \, f x + i \, e\right )}\right ) +{\left (2 i \, b d f x + 2 i \, b c f\right )} \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right ) + 1\right ) +{\left (b d f x + b c f\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1\right ) +{\left (b d f x + b c f\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} - 2 \, \cos \left (f x + e\right ) + 1\right )}{2 \, f^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*(a+b*cot(f*x+e)),x, algorithm="maxima")

[Out]

1/2*((a - I*b)*d*f^2*x^2 + 2*(a - I*b)*c*f^2*x - 2*I*b*d*f*x*arctan2(sin(f*x + e), -cos(f*x + e) + 1) + 2*I*b*
c*f*arctan2(sin(f*x + e), cos(f*x + e) - 1) - 2*I*b*d*dilog(-e^(I*f*x + I*e)) - 2*I*b*d*dilog(e^(I*f*x + I*e))
 + (2*I*b*d*f*x + 2*I*b*c*f)*arctan2(sin(f*x + e), cos(f*x + e) + 1) + (b*d*f*x + b*c*f)*log(cos(f*x + e)^2 +
sin(f*x + e)^2 + 2*cos(f*x + e) + 1) + (b*d*f*x + b*c*f)*log(cos(f*x + e)^2 + sin(f*x + e)^2 - 2*cos(f*x + e)
+ 1))/f^2

________________________________________________________________________________________

Fricas [B]  time = 1.76417, size = 595, normalized size = 7.17 \begin{align*} \frac{2 \, a d f^{2} x^{2} + 4 \, a c f^{2} x - i \, b d{\rm Li}_2\left (\cos \left (2 \, f x + 2 \, e\right ) + i \, \sin \left (2 \, f x + 2 \, e\right )\right ) + i \, b d{\rm Li}_2\left (\cos \left (2 \, f x + 2 \, e\right ) - i \, \sin \left (2 \, f x + 2 \, e\right )\right ) - 2 \,{\left (b d e - b c f\right )} \log \left (-\frac{1}{2} \, \cos \left (2 \, f x + 2 \, e\right ) + \frac{1}{2} i \, \sin \left (2 \, f x + 2 \, e\right ) + \frac{1}{2}\right ) - 2 \,{\left (b d e - b c f\right )} \log \left (-\frac{1}{2} \, \cos \left (2 \, f x + 2 \, e\right ) - \frac{1}{2} i \, \sin \left (2 \, f x + 2 \, e\right ) + \frac{1}{2}\right ) + 2 \,{\left (b d f x + b d e\right )} \log \left (-\cos \left (2 \, f x + 2 \, e\right ) + i \, \sin \left (2 \, f x + 2 \, e\right ) + 1\right ) + 2 \,{\left (b d f x + b d e\right )} \log \left (-\cos \left (2 \, f x + 2 \, e\right ) - i \, \sin \left (2 \, f x + 2 \, e\right ) + 1\right )}{4 \, f^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*(a+b*cot(f*x+e)),x, algorithm="fricas")

[Out]

1/4*(2*a*d*f^2*x^2 + 4*a*c*f^2*x - I*b*d*dilog(cos(2*f*x + 2*e) + I*sin(2*f*x + 2*e)) + I*b*d*dilog(cos(2*f*x
+ 2*e) - I*sin(2*f*x + 2*e)) - 2*(b*d*e - b*c*f)*log(-1/2*cos(2*f*x + 2*e) + 1/2*I*sin(2*f*x + 2*e) + 1/2) - 2
*(b*d*e - b*c*f)*log(-1/2*cos(2*f*x + 2*e) - 1/2*I*sin(2*f*x + 2*e) + 1/2) + 2*(b*d*f*x + b*d*e)*log(-cos(2*f*
x + 2*e) + I*sin(2*f*x + 2*e) + 1) + 2*(b*d*f*x + b*d*e)*log(-cos(2*f*x + 2*e) - I*sin(2*f*x + 2*e) + 1))/f^2

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \cot{\left (e + f x \right )}\right ) \left (c + d x\right )\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*(a+b*cot(f*x+e)),x)

[Out]

Integral((a + b*cot(e + f*x))*(c + d*x), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (d x + c\right )}{\left (b \cot \left (f x + e\right ) + a\right )}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*(a+b*cot(f*x+e)),x, algorithm="giac")

[Out]

integrate((d*x + c)*(b*cot(f*x + e) + a), x)